searchenginetracker: Fix prefix searches
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 6 Jun 2016 22:27:19 +0000 (00:27 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 6 Jun 2016 22:56:38 +0000 (00:56 +0200)
With the FTS5 query syntax, when using quotes to delimit the search phrase
the '*' token must happen after the quote, or will otherwise be considered
a character to match, go through the tokenizer, and end up ignored in
result.

gtk/gtksearchenginetracker.c

index 0d38d5aebdbd14b7e0531674c79057299692c234..665f1669551ebf31c1457d32570cebea2018923b 100644 (file)
@@ -242,10 +242,10 @@ sparql_append_string_literal (GString     *sparql,
 
   if (is_dir_uri)
     g_string_append_c (sparql, '/');
-  if (glob)
-    g_string_append_c (sparql, '*');
   if (quoted)
     g_string_append (sparql, "\\\"");
+  if (glob)
+    g_string_append_c (sparql, '*');
   g_string_append_c (sparql, '"');
 
   g_free (s);